<?php
include_once("mysql_conn.php");
$name = ($_REQUEST['name']==NULL)?'null' : $_REQUEST['name'];
$username = ($_REQUEST['username']==NULL)?'null' : $_REQUEST['username'];
$password = ($_REQUEST['password']==NULL)?'null':$_REQUEST['password'];
$sex = ($_REQUEST['sex'] == 'man')?1:2;
$phone = ($_REQUEST['phone']==NULL)?'null':$_REQUEST['phone'];
$addr = ($_REQUEST['location']==NULL)?'null':$_REQUEST['location'];
echo $name .$username.$password.$sex.$phone.$addr;
$sql ="insert into user (`name`,`password`,username,sex,phone,addr) VALUES (
'".$name."','".
        $password."','".$username."','".$sex."','".$phone."','".$addr."')";
$conn = new mysql_conn();
$conn ->add_upadate($sql);
$url = "login.php";
if (isset($url))
{
    Header("Location: $url");
}
?>